/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


/*************************************************************************
 *\author: starlove
 *************************************************************************/
#ifndef __CC_PYTHON_IMPORT_O_PARTICLE__
#define __CC_PYTHON_IMPORT_O_PARTICLE__

#include <cocos2d.h>
#include "python_object_nodeobjects.h"

NS_CCPY_BEGIN

	CC_STRUCT_DEF(CPyParticle, cocos2d::sCCParticle);
	CC_STRUCT_DEF_END
		
	CCNODE_OBJECT_WRAPPER_DEF(CCParticleBatchNode)

	class CPyParticleBatchNode : public CPyCCObject
	{
	PYCLASS_DEF_INTERFACE(CPyParticleBatchNode)
	public:
		CPyParticleBatchNode();
	};

	//CCNODE_OBJECT_WRAPPER_DEF(CCParticleSystem)

	class CPyParticleSystem : public CPyCCObject
	{
	PYCLASS_DEF_INTERFACE(CPyParticleSystem)
	public:
		CPyParticleSystem();
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, Gravity);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, Speed);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, SpeedVar);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, TangentialAccel);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, TangentialAccelVar);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, RadialAccel);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, RadialAccelVar);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, RotationIsDir);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, StartRadius);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, StartRadiusVar);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, EndRadius);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, EndRadiusVar);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, RotatePerSecond);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, RotatePerSecondVar);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, BlendAdditive);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, StartSize);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, StartSizeVar);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, EndSize);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, EndSizeVar);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, StartColor);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, StartColorVar);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, EndColor);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, EndColorVar);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, StartSpin);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, StartSpinVar);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, EndSpin);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, EndSpinVar);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, EmissionRate);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, TotalParticles);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, PositionType);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, EmitterMode);
		PYCLASS_GETSET_MAPPING_DEF(CPyParticleSystem, AutoRemoveOnFinish);

		PYCLASS_GET_DEF(CPyParticleSystem, isFull);
		PYCLASS_SET_DEF(CPyParticleSystem, Scale);
		PYCLASS_SET_DEF(CPyParticleSystem, Rotation);
		PYCLASS_SET_DEF(CPyParticleSystem, ScaleX);
		PYCLASS_SET_DEF(CPyParticleSystem, ScaleY);    
		PYCLASS_GET_DEF(CPyParticleSystem, isActive);

		PYCLASS_METHOD_DEF(CPyParticleSystem, addParticle);
		//PYCLASS_METHOD_DEF(CPyParticleSystem, initParticle);
		PYCLASS_METHOD_DEF(CPyParticleSystem, stopSystem);
		PYCLASS_METHOD_DEF(CPyParticleSystem, resetSystem);
		//PYCLASS_METHOD_DEF(CPyParticleSystem, updateQuadWithParticle);
		PYCLASS_METHOD_DEF(CPyParticleSystem, postStep);
		PYCLASS_METHOD_DEF(CPyParticleSystem, updateWithNoTime);
    	PYCLASS_METHOD_DEF(CPyParticleSystem, initWithTotalParticles);
	};
	
	CCNODE_OBJECT_WRAPPER_DEF(CCParticleSystemQuad)
	class CPyParticleSystemQuad : public CPyCCObject
	{
	PYCLASS_DEF_INTERFACE(CPyParticleSystemQuad)
	public:
		CPyParticleSystemQuad();
		PYCLASS_METHOD_DEF(CPyParticleSystemQuad, initIndices);
		PYCLASS_METHOD_DEF(CPyParticleSystemQuad, initTexCoordsWithRect);
    	PYCLASS_METHOD_DEF(CPyParticleSystemQuad, setDisplayFrame);
    	PYCLASS_METHOD_DEF(CPyParticleSystemQuad, setBatchNode);    
    	PYCLASS_METHOD_DEF(CPyParticleSystemQuad, listenBackToForeground);
	};

#define PARTICLE_SAMPLE_DEF(type_name)\
	CCNODE_OBJECT_WRAPPER_DEF(CC##type_name)\
	class CPy##type_name : public CPyCCObject\
	{\
	PYCLASS_DEF_INTERFACE(CPy##type_name)\
	public:\
		CPy##type_name();\
	};\

	PARTICLE_SAMPLE_DEF(ParticleFire);
	PARTICLE_SAMPLE_DEF(ParticleFireworks);
	PARTICLE_SAMPLE_DEF(ParticleSun);
	PARTICLE_SAMPLE_DEF(ParticleGalaxy);
	PARTICLE_SAMPLE_DEF(ParticleFlower);
	PARTICLE_SAMPLE_DEF(ParticleMeteor);
	PARTICLE_SAMPLE_DEF(ParticleSpiral);
	PARTICLE_SAMPLE_DEF(ParticleExplosion);
	PARTICLE_SAMPLE_DEF(ParticleSmoke);
	PARTICLE_SAMPLE_DEF(ParticleSnow);
	PARTICLE_SAMPLE_DEF(ParticleRain);

NS_CCPY_END

#endif